﻿using System.Collections.Generic;
using Gumini.JulaDB.Data;
using Gumini.JulaDB.Interfaces;

namespace Gumini.JulaDB.Engine
{
    /// <summary>
    /// A table created from joining other tables.
    /// </summary>
    public class RecordSet
    {
        private readonly List<Row> _rows;
        private readonly IHeading<IColumn> _columns;

        /// <summary>
        /// Initializes a new instance of the <see cref="RecordSet"/> class.
        /// </summary>
        public RecordSet(IHeading<IColumn> columns, List<Row> rows)
        {
            _columns = columns;
            _rows = rows;
        }

        /// <summary>
        /// Gets the collection of rows in the result.
        /// </summary>
        public List<Row> Rows
        {
            get { return _rows; }
        }

        /// <summary>
        /// Gets the collection of columns.
        /// </summary>
        public IHeading<IColumn> Heading
        {
            get { return _columns; }
        }
    }
}
